<?php

use Illuminate\Support\Facades\Route;

Route::middleware(['VerifyToken'])->group(function () {
    Route::post('admin/import', 'App\Admin\Controllers\Permission\AdminController@import')->name('admin.import');
    Route::get('getInfo', 'App\Admin\Controllers\Permission\AdminController@getInfo')->name('getInfo');
    Route::get('getMenus', 'App\Admin\Controllers\Permission\AdminController@getMenus')->name('getMenus');
    Route::get('getCodes', 'App\Admin\Controllers\Permission\AdminController@getCodes')->name('getCodes');
    Route::put('admin/{id}/setStatus', 'App\Admin\Controllers\Permission\AdminController@setStatus')->name('admin.setStatus');
    Route::put('role/{id}/setStatus', 'App\Admin\Controllers\Permission\RoleController@setStatus')->name('role.setStatus');
    Route::get('role/getRoleAll', 'App\Admin\Controllers\Permission\RoleController@getRoleAll')->name('role.getRoleAll');
    Route::apiResource('admin', 'App\Admin\Controllers\Permission\AdminController');
    Route::apiResource('role', 'App\Admin\Controllers\Permission\RoleController');
    Route::apiResource('menu', 'App\Admin\Controllers\Permission\MenuController');
    Route::apiResource('logs', 'App\Admin\Controllers\Permission\LogsController')->only(['index', 'show', 'destroy']);
});

// 登录
Route::post('login', 'App\Admin\Controllers\LoginController@login')->name('login');
// 退出
Route::post('logout', 'App\Admin\Controllers\LoginController@logout')->name('logout');
